﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Dialog.Master" AutoEventWireup="true"
    CodeBehind="ConfirmAccountReceipt.aspx.cs" Inherits="NetDon.OA.Portal.Finance.ConfirmAccountReceipt" %>

<%@ Register TagPrefix="uc1" TagName="RequiredMark_1" Src="~/Controls/RequiredMark.ascx" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    <script language="javascript" type="text/javascript">
        function deleteInvoiceAccountReceipt(issuingOrderDeliveryId) {
            $confirm("确定要删除该收款记录吗？", function (result) {
                if (result == true) {
                    $text($get('<%=hfdIssuingOrderDeliveryId.ClientID %>'), issuingOrderDeliveryId);
                    $get('<%=btnIssuingOrderDeliveryDelete.ClientID %>').click();
                }
            });
        }


        function onChangeDeliveryCode(obj, foucsControlId, rowIndex) {
            var deliveryCode = $(obj).val();
            if (deliveryCode.trim() != "") {

                $text($get('<%=HiddenDeliveryCode.ClientID %>'), deliveryCode);
                $text($get('<%=HiddenRowIndex.ClientID %>'), rowIndex);

                setFocus(obj, foucsControlId);
                $get('<%=btnHiddenDeliveryCodeChanged.ClientID %>').click();

            }

        }




    </script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <asp:Panel ID="panelBasic" runat="server" DefaultButton="btnSave">
        <table border="0" cellpadding="0" cellspacing="0" width="100%">
            <tr>
                <td>
                    <NetDon:FormPanel ID="FormPanelIssuringOrderInfo" runat="server" CaptionAlign="NotSet"
                        RepeatColumns="2" SkinID="ProductView">
                        <Items>
                            <NetDon:FormItem FullRow="True" HeaderVisible="False">
                                <ContentTemplate>
                                    <asp:Literal ID="Literal2" runat="server" Text="发票信息"></asp:Literal>
                                </ContentTemplate>
                            </NetDon:FormItem>
                            <NetDon:FormItem HeaderText="线路分类">
                                <ContentTemplate>
                                    <asp:Label runat="server" ID="lblRouteName">	</asp:Label>
                                </ContentTemplate>
                            </NetDon:FormItem>
                            <NetDon:FormItem HeaderText="客户名称">
                                <ContentTemplate>
                                    <asp:Label runat="server" ID="txtCustomerName">	</asp:Label>
                                </ContentTemplate>
                            </NetDon:FormItem>
                            <NetDon:FormItem HeaderText="费用描述" ColumnSpan="2">
                                <ContentTemplate>
                                    <asp:Label ID="txtExpenseDescription" runat="server" Text='<%#Bind("ExpenseDescription") %>'></asp:Label>
                                </ContentTemplate>
                            </NetDon:FormItem>
                            <NetDon:FormItem HeaderText="开票日期">
                                <ContentTemplate>
                                    <asp:Label ID="txtConfirmInvoiceDate" Text='<%#Eval("ConfirmInvoiceDate") != null ? ((DateTime)Eval("ConfirmInvoiceDate")).ToString("yyyy-MM-dd") : ""%>'
                                        runat="server"></asp:Label>
                                </ContentTemplate>
                            </NetDon:FormItem>
                            <NetDon:FormItem HeaderText="发票号码">
                                <ContentTemplate>
                                    <asp:Label ID="txtInvoiceNO" runat="server" Text='<%#Bind("InvoiceNO") %>' Width="450px"></asp:Label>
                                </ContentTemplate>
                            </NetDon:FormItem>
                            <NetDon:FormItem HeaderText="发票类型">
                                <ContentTemplate>
                                    <asp:Label runat="server" ID="Label3" Text='<%#GetDictionaryItemName(Eval("InvoiceType")) %>'>	</asp:Label>
                                </ContentTemplate>
                            </NetDon:FormItem>
                            <NetDon:FormItem HeaderText="应收日期">
                                <ContentTemplate>
                                    <asp:Label ID="txtAccountsReceivableDate" Text='<%#Eval("AccountsReceivableDate") != null ? ((DateTime)Eval("AccountsReceivableDate")).ToString("yyyy-MM-dd") : ""%>'
                                        runat="server" Width="160"></asp:Label>
                                </ContentTemplate>
                            </NetDon:FormItem>
                            <NetDon:FormItem HeaderText="币种">
                                <ContentTemplate>
                                    <asp:Label runat="server" ID="Label2" Text='<%#GetDictionaryItemName(Eval("InvoiceCurrencyType")) %>'>	</asp:Label>
                                </ContentTemplate>
                            </NetDon:FormItem>
                            <NetDon:FormItem HeaderText="对账金额(￥)">
                                <ContentTemplate>
                                    <asp:Label ID="txtStateofAccountAmount" Text='<%#Convert.ToDecimal(Eval("StateofAccountAmount")).ToString("#,###")%>'
                                        runat="server" Style="text-align: right"></asp:Label>
                                </ContentTemplate>
                            </NetDon:FormItem>
                            <NetDon:FormItem HeaderText="开票金额(￥)" ColumnSpan="2">
                                <ContentTemplate>
                                    <asp:Label ID="txtInvoiceAmount" Text='<%#Convert.ToDecimal(Eval("InvoiceAmount")).ToString("#,###")%>'
                                        runat="server" Style="text-align: right"></asp:Label>
                                </ContentTemplate>
                            </NetDon:FormItem>
                            <NetDon:FormItem HeaderText="开票备注" ColumnSpan="2">
                                <ContentTemplate>
                                    <asp:Label ID="txtInvoiceDescription" runat="server" Text='<%#Bind("InvoiceDescription") %>'></asp:Label>
                                </ContentTemplate>
                            </NetDon:FormItem>
                            <NetDon:FormItem FullRow="True" HeaderVisible="False">
                                <ContentTemplate>
                                    <asp:Literal ID="Literal1" runat="server" Text="收款明细"></asp:Literal>
                                </ContentTemplate>
                            </NetDon:FormItem>
                            <NetDon:FormItem HeaderText="实收金额">
                                <ContentTemplate>
                                    <asp:Label ID="lblTotalAccountReceiptAmount" Text='<%#Convert.ToDecimal(Eval("TotalAccountReceiptAmount")).ToString("#,###.00")%>'
                                        runat="server" SkinID="Text80" Style="text-align: right"></asp:Label>
                                </ContentTemplate>
                            </NetDon:FormItem>
                            <NetDon:FormItem HeaderText="未付金额" ColumnSpan="2">
                                <ContentTemplate>
                                    <asp:Label ID="lblUnReceivedAmount" Text='<%#Convert.ToDecimal(Eval("UnReceivedAmount")).ToString("#,###.00")%>'
                                        runat="server" SkinID="Text80" Style="text-align: right"></asp:Label>
                                </ContentTemplate>
                            </NetDon:FormItem>
                            <NetDon:FormItem HeaderText="异常情况" ColumnSpan="2">
                                <ContentTemplate>
                                    <asp:TextBox ID="txtAccountReceiptExceptions" runat="server" Text='<%#Bind("AccountReceiptExceptions") %>'
                                        Width="100%" TextMode="MultiLine" Height="100px"></asp:TextBox>
                                </ContentTemplate>
                            </NetDon:FormItem>
                            <NetDon:FormItem HeaderText="收款备注" ColumnSpan="2">
                                <ContentTemplate>
                                    <asp:TextBox ID="txtAccountReceiptComments" runat="server" Text='<%#Bind("AccountReceiptComments") %>'
                                        Width="100%" TextMode="MultiLine" Height="100px"></asp:TextBox>
                                </ContentTemplate>
                            </NetDon:FormItem>
                            <NetDon:FormItem FullRow="True" HeaderVisible="False">
                                <ContentTemplate>
                                    <asp:Literal ID="Literal3" runat="server" Text="实收信息"></asp:Literal>
                                </ContentTemplate>
                            </NetDon:FormItem>
                            <NetDon:FormItem HeaderText="收款否">
                                <ContentTemplate>
                                    <asp:CheckBox runat="server" ID="chbIsAccountReceipt"   Checked='<%#Bind("IsAccountReceiptCompleted") %>' Enabled="False"/>
                                </ContentTemplate>
                            </NetDon:FormItem>
                        </Items>
                    </NetDon:FormPanel>
                    <NetDon:FormPanel ID="FormPanelRenvenueMachineAccountInvoiceReceipt" runat="server"
                        CaptionAlign="NotSet">
                        <Items>
                            <NetDon:FormItem HeaderText="">
                                <ContentTemplate>
                                    <NetDon:GridView ID="gridOrderDetailList" runat="server" AutoGenerateColumns="False"
                                        OnRowDataBound="gridOrderDetailList_RowDataBound" DataKeyNames="Id" CssClass="IncrementalTable"
                                        Width="300px">
                                        <Columns>
                                            <NetDon:IndexField HeaderText="序号">
                                            </NetDon:IndexField>
                                            <NetDon:TemplateField HeaderText="银票号码">
                                                <ItemTemplate>
                                                    <asp:TextBox ID="txtBankNoteNO" Text='<%#Eval("BankNoteNO")%>' MaxLength="50" Width="90px"
                                                        runat="server"></asp:TextBox>
                                                    <br />
                                                </ItemTemplate>
                                            </NetDon:TemplateField>
                                            <NetDon:TemplateField HeaderText="币种">
                                                <ItemTemplate>
                                                    <asp:DropDownList ID="ddlCurrencyType" DataSourceID="ddsCurrencyType" AppendDataBoundItems="true"
                                                        runat="server" DataTextField="Name" DataValueField="Value" Width="90px">
                                                    </asp:DropDownList>
                                                    <NetDon:DictionaryDataSource ID="ddsCurrencyType" runat="server" CategoryName="币种"
                                                        EmptyItemType="Select">
                                                    </NetDon:DictionaryDataSource>
                                                    <br />
                                                </ItemTemplate>
                                            </NetDon:TemplateField>
                                            <NetDon:TemplateField HeaderText="实收金额">
                                                <ItemTemplate>
                                                    <asp:TextBox ID="txtAccountsReceiptAmount" Text='<%#Convert.ToDecimal(Eval("AccountsReceiptAmount")).ToString("#,###.00")%>'
                                                        runat="server" SkinID="Text50" Style="text-align: right"></asp:TextBox>
                                                    <NetDon:NumericEditExtender ID="NumericEditExtender4" runat="server" TargetControlID="txtAccountsReceiptAmount"
                                                        DataMode="Double">
                                                    </NetDon:NumericEditExtender>
                                                    <asp:RequiredFieldValidator ID="RequiredFieldValidator333" runat="server" ControlToValidate="txtAccountsReceiptAmount"
                                                        Display="None" ErrorMessage="请输入实收金额" SetFocusOnError="True"></asp:RequiredFieldValidator>
                                                </ItemTemplate>
                                            </NetDon:TemplateField>
                                            <NetDon:TemplateField HeaderText="收款方式">
                                                <ItemTemplate>
                                                    <asp:DropDownList ID="ddlAccountsReceiptType" DataSourceID="ddsAccountsReceiptType"
                                                        AppendDataBoundItems="true" runat="server" DataTextField="Name" DataValueField="Value"
                                                        Width="90px">
                                                    </asp:DropDownList>
                                                    <NetDon:DictionaryDataSource ID="ddsAccountsReceiptType" runat="server" CategoryName="收款方式"
                                                        EmptyItemType="Select">
                                                    </NetDon:DictionaryDataSource>
                                                    <br />
                                                </ItemTemplate>
                                            </NetDon:TemplateField>
                                            <NetDon:TemplateField HeaderText="收款日期">
                                                <ItemTemplate>
                                                    <asp:TextBox ID="txtConfirmAccountsReceiptDate" Text='<%#Eval("ConfirmAccountsReceiptDate") != null ? ((DateTime)Eval("ConfirmAccountsReceiptDate")).ToString("yyyy-MM-dd") : ""%>'
                                                        runat="server" Width="100px"></asp:TextBox>
                                                    <uc1:RequiredMark_1 ID="RequiredMark42" runat="server" />
                                                    <asp:CalendarExtender ID="txtConfirmAccountsReceiptDateCalendarExtender1" runat="server"
                                                        Animated="False" Enabled="True" FirstDayOfWeek="Sunday" TargetControlID="txtConfirmAccountsReceiptDate"
                                                        Format="yyyy-MM-dd">
                                                    </asp:CalendarExtender>
                                                    <asp:CustomValidator ID="txtConfirmAccountsReceiptDateCustomValidator1" ClientValidationFunction="validateDateText"
                                                        runat="server" ErrorMessage="收款日期无效." Display="None" ControlToValidate="txtConfirmAccountsReceiptDate"
                                                        OnServerValidate="DateValidator_ServerValidate"></asp:CustomValidator>
                                                 
                                                </ItemTemplate>
                                            </NetDon:TemplateField>
                                            <NetDon:TemplateField HeaderText="汇票到期日">
                                                <ItemTemplate>
                                                    <asp:TextBox ID="txtBillOfExchangeDueDate" Text='<%#Eval("BillOfExchangeDueDate") != null ? ((DateTime)Eval("BillOfExchangeDueDate")).ToString("yyyy-MM-dd") : ""%>'
                                                        runat="server" Width="100px"></asp:TextBox>
                                                    <uc1:RequiredMark_1 ID="RequiredMark41" runat="server" />
                                                    <asp:CalendarExtender ID="txtBillOfExchangeDueDateCalendarExtender1" runat="server"
                                                        Animated="False" Enabled="True" FirstDayOfWeek="Sunday" TargetControlID="txtBillOfExchangeDueDate"
                                                        Format="yyyy-MM-dd">
                                                    </asp:CalendarExtender>
                                                    <asp:CustomValidator ID="txtBillOfExchangeDueDateCustomValidator1" ClientValidationFunction="validateDateText"
                                                        runat="server" ErrorMessage="汇票到期日无效." Display="None" ControlToValidate="txtBillOfExchangeDueDate"
                                                        OnServerValidate="DateValidator_ServerValidate"></asp:CustomValidator>
                                                 
                                                </ItemTemplate>
                                            </NetDon:TemplateField>
                                            <NetDon:TemplateField HeaderText="备注">
                                                <ItemTemplate>
                                                    <asp:TextBox ID="txtComments" runat="server" Text='<%#Bind("Comments") %>' Width="150px"
                                                        MaxLength="250" TextMode="MultiLine" Height="40px"></asp:TextBox>
                                                </ItemTemplate>
                                            </NetDon:TemplateField>
                                            <NetDon:TemplateField HeaderText="操作" ItemStyle-Width="50px">
                                                <ItemTemplate>
                                                    <asp:ImageButton ID="btnDelete" runat="server" CausesValidation="false" SkinID="Delete" />
                                                </ItemTemplate>
                                            </NetDon:TemplateField>
                                        </Columns>
                                    </NetDon:GridView>
                                </ContentTemplate>
                            </NetDon:FormItem>
                        </Items>
                    </NetDon:FormPanel>
                </td>
            </tr>
            <tr>
                <td style="padding-left: 150px">
                    <asp:Button ID="btnSave" runat="server" SkinID="Button80" Text="保存" OnClick="btnSave_Click" />
                    <asp:Button ID="btnCancel" runat="server" SkinID="Button80" Text="取消" CausesValidation="false" />
                    <NetDon:ValidationSummary ID="ValidationSummary1" runat="server" ShowMessageBox="true"
                        ShowSummary="false" />
                    <asp:HiddenField ID="hfdIssuingOrderDeliveryId" runat="server" />
                    <asp:Button ID="btnIssuingOrderDeliveryDelete" runat="server" SkinID="Hidden" CausesValidation="false"
                        OnClick="btnIssuingOrderDeliveryDelete_Click"></asp:Button>
                    <asp:Button ID="btnHiddenDeliveryCodeChanged" runat="server" SkinID="Hidden" CausesValidation="false"
                        OnClick="txtDeliveryOrderCode_SelectedIndexChanged"></asp:Button>
                    <asp:HiddenField ID="HiddenDeliveryCode" runat="server" />
                    <asp:HiddenField ID="HiddenRowIndex" runat="server" />
                </td>
            </tr>
        </table>
    </asp:Panel>
</asp:Content>
